<div class="forums">
<h2 class="heading">Forums</h2>
<?php if( count($forums) === 0 ): ?>
	No forums yet.
<?php endif; ?>
<?php foreach($forums as $row):?>
<div class="forum">
<?php 	if( $isAdmin ) : ?>
	<div class="delete">(<a href="/org/view/<?php echo $orgname ?>/forum/delete/<?php View::show($row['forum_id'])?>">Delete</a>)</div>
	<div class="edit">(<a href="/org/view/<?php echo $orgname ?>/forum/edit/<?php View::show($row['forum_id'])?>">Edit</a>)</div>
<?php 	endif; ?>
	<div class="title"><a href="/org/view/<?php echo $orgname ?>/forum/view/<?php View::show($row['forum_id']) ?>"><?php View::show($row['title'])?></a></a></div>
	<div class="description"><?php View::show($row['description'])?></div>
	<div class="posts">Posts: <?php View::show($row['post_no'])?></div>
<?php if( $row['date'] !== NULL ) : ?>	
	<div class="lastpost-date">
		<span class="label">Last posted on:<span> <?php View::show(date('l, dS \of F Y h:i:sa', strtotime($row['date']) + 8*3600)) ?></span>
	</div>
	<div class="lastpost-author"><span class="label">by:</span><?php View::show( ucwords( strtolower( $row['lastname'])))?>, <?php View::show(ucwords( strtolower( $row['firstname'])))?> 
					<?php View::show(ucwords( strtolower( $row['middlename']{0} )))?>.</div>
<?php	else: ?>		
	<div class="lastpost-author"><span>No posts yet</span></div>
<?php	endif; ?>
</div>
<?php endforeach ; ?> <?php if( $isAdmin ) : ?>
<div class="add"><a href="/org/view/<?php echo $orgname ?>/forum/new">Create new forum</a></div>
<?php endif; ?>

</div>